package core;

import javax.swing.JFrame;

public class TD_Multiplexer extends UnitAbstract {

	public TD_Multiplexer() {
		inputs = new String[]{"1", "2", "3", "4"};
		outputs = new String[]{"0"};
	}
	
	@Override
	public void read(DataPackage dataPack, String tPort) {
		
		double[] data = new double[dataPack.data.length + 1];
		
		data[0] = Double.parseDouble(tPort);
		
		System.arraycopy(dataPack.data, 0, data, 1, dataPack.data.length);
			
		dataPack.data = data;
		sendData(dataPack, "0");
	}

	@Override
	public JFrame getFrame() {
		// TODO Auto-generated method stub
		return null;
	}
	
	@Override
	public String toString() {
		return "Multiplexer TDM";
	}
	
}
